version 13.0
log using "C:\Users\mgolder\Dropbox\campaign_sentiment_paper\replication\germany2013\germany.log", replace
#delimit ;

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      germany.do                                      *;
*       Date:           January 16, 2019                                *;
*       Author:         MRG/CC/TG                                       *;
*       Purpose:      	Produce results with respect to the analysis of *;
*                       the German 2013 elections for the appendix for  *;
*                       It's Not Only What You Say, It's Also How You   *;
*                       Say It: The Strategic Use Of Campaign           *;
*                       Sentiment. Journal of Politics. Forthcoming.    *;
* 	    Input File:     germany.dta                                     *;
*       Output File:    none                                            *;
*       Data Output:    none                                            *;             
*       Previous file:  germany.dta                                     *;
*       Machine:        desktop/laptop                     				*;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*        Load data                                                      *;
*     ****************************************************************  *;

use "C:\Users\mgolder\Dropbox\campaign_sentiment_paper\replication\germany2013\germany.dta", clear;

*     ****************************************************************  *;
*       Label variables                                                 *;
*     ****************************************************************  *;

label var parties "party name";
label var incumbent " 1 if incumbent party, 0 otherwise";
label var prime_minister "1 if prime minister, 0 otherwise";
label var mainstream "1 if mainstream party, 0 otherwise";
label var tv_duell "1 if in TV-Duell, 0 if in TB-Dreikampf";
label var manifestos_positive_sentiment "level of positive sentiment in manifestos";
label var manifesto_words "word count in manifestos";
label var peb_words "word count in party election broadcasts";
label var peb_positive_sentiment "level of positive sentiment in party election broadcast";
label var debate_words "word count in tv debate";
label var debate_positive_sentiment "level of positive sentiment in tv debates";
label var website_words "word count on website front page";
label var website_positive_sentiment "level of positive sentiment on website front page";

*     ****************************************************************  *;
*		Manifestos													    *;
*     ****************************************************************  *;

sum manifesto_words, detail;

sum manifestos_positive_sentiment;

sum manifestos_positive_sentiment if incumbent==1;

sum manifestos_positive_sentiment if incumbent==0;

sum manifestos_positive_sentiment if prime_minister==1;

sum manifestos_positive_sentiment if prime_minister==0 & incumbent==1;

sum manifestos_positive_sentiment if mainstream==1;

sum manifestos_positive_sentiment if mainstream==0;

*     ****************************************************************  *;
*		Party Election Broadcasts						                *;
*     ****************************************************************  *;

sum peb_words;

sum peb_words, detail;

sum peb_positive_sentiment if incumbent==1;

sum peb_positive_sentiment if incumbent==0;

sum peb_positive_sentiment if prime_minister==1;

sum peb_positive_sentiment if prime_minister==0 & incumbent==1;

sum peb_positive_sentiment if mainstream==1;

sum peb_positive_sentiment if mainstream==0;

*     ****************************************************************  *;
*		Websites						                                *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*		As reported in the appendix, we downloaded the frontpage of     *;
*		a party's website a month before the election (August 24).      *;
*		Due to an error, we downloaded the frontpage of the Left 		*;
*		Party 1075 times over a number of days. While the number 	    *;
*		of words on the main page did not change much, there was	    *;
*		some variation. The number of words reported in the data	    *;
*		for the Left Party is the average number of words:			    *;
*		424070/1075 = 394.											    *;
*     ****************************************************************  *;

sum website_words;

sum website_positive_sentiment if incumbent==1;

sum website_positive_sentiment if incumbent==0;

sum website_positive_sentiment if prime_minister==1;

sum website_positive_sentiment if prime_minister==0 & incumbent==1;

sum website_positive_sentiment if mainstream==1;

sum website_positive_sentiment if mainstream==0;

*     ****************************************************************  *;
*		Debates													        *;
*     ****************************************************************  *;

sum debate_words if tv_duell==1;

sum debate_words if tv_duell==0;

sum debate_positive_sentiment if incumbent==1;

sum debate_positive_sentiment if incumbent==0;

sum debate_positive_sentiment if prime_minister==1;

sum debate_positive_sentiment if prime_minister==0 & incumbent==1;

sum debate_positive_sentiment if mainstream==1;

sum debate_positive_sentiment if mainstream==0;

clear;

* ********************************************************************* *; 
*       The effect of election debate                                   *;
* ********************************************************************* *; 

* ********************************************************************* *; 
*       Data from 2013 - TV debate panel study                          *;           
* 	    Input File:     ZA5709_v3-0-0                                   *;                           
*       Data Output:    none                                            *;                          
* ********************************************************************  *;

* ********************************************************************  *; 
*       Note: We dropped 11 observations that did not participate in    *;
*       pre- and posttest (Wave 1 & 2) using the following code:        *;
*       keep if teil12 == 1                                             *;
* ********************************************************************  *; 
 
* ********************************************************************  *; 
*       Load subset of TV Debate panel data                             *;
* ********************************************************************  *; 

use "C:\Users\mgolder\Dropbox\campaign_sentiment_paper\replication\germany2013\debate.dta", clear;

* ********************************************************************  *; 
*       Get rid of missing values                                       *;
* ********************************************************************  *; 

mvdecode a6 a8 a9 a10 a12 a13 b6 b8 b9 b10 b12 b13, mv(-99=. \ -95=.);

* ********************************************************************  *; 
*       EVALUTATION variables and labels for Wave I (pre-debate)        *;
*       We recode the relevant EVALUATION variables of the original     *;
*       data (ZA5709 Data file Version 3.0.0) such that higher values   *;
*       indicate more positive evaluations. Thus, recoding 1->5, 2->4   *;
*       yields the new EVALUATION variables.                            *;
* ********************************************************************  *; 

gen a6new  = - a6  + 6;
gen a8new  = - a8  + 6;
gen a9new  = - a9  + 6;
gen a10new = - a10 + 6;
gen a12new = - a12 + 6;
gen a13new = - a13 + 6;

* ********************************************************************  *; 
*       How has your own economic situation developed in the last one   *;
*       to two years?                                                   *;
* ********************************************************************  *; 
 
label define improve 5 "improved a lot"  4 "improved a bit"  3 "stayed the same" 2 "got a bit worse" 1 "got a lot worse";
label values a6new improve;
label variable a6new  "Own economic situation, retrospective";

* ********************************************************************  *; 
*       How do you currently rate your own economic situation?          *;
* ********************************************************************  *; 

label define good 5 "very good"  4 "good"  3 "partly good, partly bad" 2 "bad" 1 "very bad";
label values a8new good ;
label variable a8new  "Own economic situation, current";

* ********************************************************************  *; 
*       What do you think? How will your own economic situation be like *;
*       in a year's time?                                               *;
* ********************************************************************  *; 

label values a9new improve ;
label variable a9new  "Own economic situation, prospective";

* ********************************************************************  *; 
*       How has the economic situation in Germany developed in the last *;
*       one to two years?                                               *;
* ********************************************************************  *; 

label values a10new improve; 
label variable a10new  "General economic situation, retrospective";

* ********************************************************************  *; 
*       How do you currently rate the economic situation in Germany?    *;
* ********************************************************************  *; 

label values a12new good ;
label variable a12new  "General economic situation, current";

* ********************************************************************  *; 
*       How will the economic situation in Germany be in a year's time? *;
* ********************************************************************  *; 

label values a13new improve; 
label variable a13new  "General economic situation, prospective";

* ********************************************************************  *; 
*       EVALUTATION variables and labels for Wave II (post-debate)      *;
*       Thus, recoding 1->5, 2->4 yields the new EVALUATION variables   *;
* ********************************************************************  *; 

gen b6new  = - b6  + 6;
gen b8new  = - b8  + 6;
gen b9new  = - b9  + 6;
gen b10new = - b10 + 6;
gen b12new = - b12 + 6;
gen b13new = - b13 + 6;

* ********************************************************************  *; 
*       How has your own economic situation developed in the last one   *;
*       to two years?                                                   *;
* ********************************************************************  *; 

label values b6new improve ;
label variable b6new  "Own economic situation, retrospective";

* ********************************************************************  *; 
*       How do you currently rate your own economic situation?          *;
* ********************************************************************  *; 

label values b8new good; 
label variable b8new  "Own economic situation, current";

* ********************************************************************  *; 
*       What do you think? How will your own economic situation be like *;
*       in a year's time?                                               *;
* ********************************************************************  *; 

label values b9new improve; 
label variable b9new  "Own economic situation, prospective";

* ********************************************************************  *; 
*       How has the economic situation in Germany developed in the last *;
*       one to two years?                                               *;
* ********************************************************************  *; 

label values b10new improve; 
label variable b10new  "General economic situation, retrospective";

* ********************************************************************  *; 
*       How do you currently rate the economic situation in Germany?    *;
* ********************************************************************  *; 

label values b12new good;
label variable b12new  "General economic situation, current";

* ********************************************************************  *; 
*       How will the economic situation in Germany be in a year's time? *;
* ********************************************************************  *; 

label values b13new improve;
label variable b13new  "General economic situation, prospective";


* ********************************************************************  *; 
*       Dependent Variables                                             *;
*       Calculate each DV as first difference,                          *;
*       i.e., difference EVALUATION_{t_2} - EVALUATION_{t_1}            *;
*       to leverage pre-post design with TV debate as `treatment'.      *;
*       Thus, we have six DVs                                           *;
* ********************************************************************  *; 

gen dif6  = b6new  -a6new;
gen dif8  = b8new  -a8new;
gen dif9  = b9new  -a9new;
gen dif10 = b10new -a10new;
gen dif12 = b12new -a12new;
gen dif13 = b13new -a13new;

label variable dif6  "FD own economic situation, retrospective";
label variable dif8  "FD own economic situation, current";
label variable dif9  "FD own economic situation, prospective"; 
label variable dif10 "FD general economic situation, retrospective";
label variable dif12 "FD general economic situation, current";
label variable dif13 "FD general economic situation, prospective";    


* ********************************************************************  *; 
*       Independent Variable                                            *;
*       Operationalize PM  supporters using the direct measurement      *;
*       prior to debate: `Who do you prefer as chanellor?'              *;
*       (direct measurement: Merkel or Steinbrück)                      *;
* ********************************************************************  *; 

* ********************************************************************  *; 
*       Get rid of missing values                                       *;
* ********************************************************************  *; 

mvdecode a38, mv(-99=. \ -95=.);

* ********************************************************************  *; 
*       Merkel supporter = 1, undecided = ., Steinbrueck supporter = 0  *;
* ********************************************************************  *; 

gen merkel =   (a38==1);
replace merkel = . if a38==3;
replace merkel = . if a38==.;
label define yesno 1 "yes"  0 "no" ; 
label values merkel yesno ; 
label variable merkel  "PM supporter (Merkel)";

* ********************************************************************  *; 
*       OLS Analysis                                                    *;
*       We know from the debate that PM Angela Merkel (CDU) employed    *;
*       more positive emotive language than her opponent, Peer          *;
*       Steinbrück (SPD). We expect to see the prime minister’s         *;
*       supporters increase their evaluation of the economy and the     *;
*       government over the course of the debate more than supporters   *;
*       of Steinbrück, i.e. a positive coefficient in the following     *;
*       regressions.                                                    *;
* ********************************************************************  *; 

* ********************************************************************  *; 
*  Regression on FD own economic situation, retrospective               *;
* ********************************************************************  *; 

reg dif6  merkel; 

* ********************************************************************  *; 
*  Regression on FD own economic situation, current                     *;
* ********************************************************************  *;

reg dif8  merkel; 

* ********************************************************************  *; 
*  Regression on FD own economic situation, prospective                 *;
* ********************************************************************  *;

reg dif9  merkel; 

* ********************************************************************  *; 
*  Regression on FD general economic situation, retrospective           *;
* ********************************************************************  *;

reg dif10 merkel; 

* ********************************************************************  *; 
*  Regression on FD general economic situation, current                 *;
* ********************************************************************  *;

reg dif12 merkel; 

* ********************************************************************  *; 
*  Regression on FD general economic situation, prospective             *;
* ********************************************************************  *;

reg dif13 merkel;

* ********************************************************************  *;
*   No matter how respondnets evaluate their own  economic situation    *;
*   (currently, retrospectively or prospectively) or the general        *;
*   economic situation (currently, retrospectively or prospectively)    *;
*   the respective coefficients are positive. It is statistically       *;
*   significant when evaluating the state of the current economy.       *;
* ********************************************************************  *;

*     ****************************************************************  *;
*       Replication complete                                            *;
*     ****************************************************************  *;

log close;

clear;

